{% extends 'base2.html' %}
{% block title %}调剂信息发布数省份分布图{% endblock %}
{% block body_part %}
    <div class="row mt-5">
        <div id="main" style="width: 1000px; height: 1100px; margin: 0 auto"></div>
    </div>

{% endblock %}
{% block script %}
    <script type="text/javascript">
        var myChart = echarts.init(document.getElementById("main"));
        option = {
            dataset: {
                source: {{ datas | safe }}
            },
            title: {
                text: '调剂信息发布数省份分布图',
                left: 'center'
            },
            grid: {containLabel: true},
            xAxis: {name: ''},
            yAxis: {type: 'category'},
            visualMap: {
                orient: 'horizontal',
                left: 'center',
                min: 10,
                max: 100,
                text: ['High Score', 'Low Score'],
                // Map the score column to color
                dimension: 0,
                inRange: {
                    color: ['#2EFEF7', '#FFCE34', '#FD665F']
                }
            },
            series: [
                {
                    type: 'bar',
                    encode: {
                        // Map the "amount" column to X axis.
                        x: 'amount',
                        // Map the "product" column to Y axis
                        y: 'product'
                    },
                    itemStyle: {
                        normal: {
                            label: {
                                show: true, //开启显示
                                position: 'right', //在上方显示
                                textStyle: { //数值样式
                                    color: '#aaaaaa',
                                    fontSize: 16
                                }
                            }
                        }
                    },

                }
            ]
        };
        myChart.setOption(option);
    </script>
<p align="center"><b>调剂信息发布数量最多的省份/市为北京市，其次是辽宁省，再次是广东省。</b></p>
{% endblock %}